package main

import "fmt"

func maxPoints(points [][]int) int {
	type node struct {
		dx int
		dy int
	}
	max := 0

	for i := 0; i < len(points); i++ {
		m := make(map[node]int)

		for j := 0; j < len(points); j++ {
			if i == j {
				continue
			}
			n := node{}
			n.dx = points[i][0] - points[j][0]
			n.dy = points[i][1] - points[j][1]

			if n.dx == 0 {
				n.dy = 1
				m[n]++
			} else if n.dy == 0 {
				n.dx = 1
				m[n]++
			} else {
				if n.dx < 0 {
					n.dx = -n.dx
					n.dy = -n.dy
				}

				ret := gcd(n.dx, n.dy)
				n.dx /= ret
				n.dy /= ret

				m[n]++
			}
		}

		for _, v := range m {
			if max < v {
				max = v
			}
		}
	}

	return max + 1
}
func gcd(a, b int) int {
	for a != 0 {
		a, b = b%a, a
	}
	return b
}

func main() {

	fmt.Println(gcd(-3, 4))

	//fmt.Println(maxPoints([][]int{{1, 1}, {2, 2}, {3, 3}}))

}
